The present invention relates generally to devices and methods for processing tone data, and more particularly to a tone data processing device and method which are arranged to collectively create, on the basis of control data, tone data that are to be generated in subframes corresponding to predetermined time periods.
Many personal computers today are equipped with a tone generator LSI to carry out various sound processing, which includes a reproduction process for playing back or reproducing tone data on the basis of waveform data and control data instructing tone generating parameters relating to a color (timbre), pitch and volume of each tone to be generated, an effect process for imparting an effect to the tone data, and a recording process for recording the tone data.
Each of such personal computers is constructed of hardware including a CPU for controlling operations in an entire tone generator device in accordance with an operating system (OS), a tone generator LSI and a memory for storing the control data and waveform data, and software including a microprogram for controlling the tone generator LSI and a device driver for controlling write and read of various data to and from the memory.
For example, the tone generator LSI can perform the above-mentioned processes on a frame-by-frame basis with each frame having a time length of 5.3 ms that is necessary for outputting 256 samples with a 48 kHz output sampling frequency (i.e., a digital-to-analog conversion or DAC rate of 48 kHz). FIG. 5 is a conceptual block diagram illustrating operational relationships between the hardware, microprogram MP and device driver DD employed in the conventional tone generator processing. Here, the term xe2x80x9chardwarexe2x80x9d refers to an output section of the tone generator LSI, i.e., a section that outputs tone data in accordance with the output sampling frequency, the term xe2x80x9cmicroprogramxe2x80x9d MP refers to a microprogram to be executed by a digital signal processor (DSP) that constitutes a principal section of the tone generator LSI, and the term xe2x80x9cdevice driverxe2x80x9d DD refers to a software program that, as mentioned above, is run by the CPU of the personal computer for controlling write/read of various data on the main memory.
First, the hardware, constituting the output section of the tone generator LSI, counts the output sampling frequency to issue an interrupt signal, commonly called a frame start signal, to the microprogram MP at start timing of a given frame. The microprogram MP is triggered by the interrupt signal and starts carrying out a predetermined frame routine on the basis of prestored control data CD so as to create 256 samples of tone data SD. This frame routine is completed before a next frame begins. As the microprogram MP is thus triggered, it also interruptively requests the device driver CD to prepare control data CD for use in the next frame. In response to the interruptive request, the device driver DD prepares the control data CD for the next frame, and once the control data DD have been prepared, it sets a flag Active2indicative of completion of the requested control data preparation. In each of the subsequent frames, similar operations are carried out.
The output section of the tone generator LSI includes two output buffers, which, for each of the frames, alternate in storing 256 samples of tone data; that is, while one set of the 256 tone data samples is written into one of the output buffers, another set of the 256 tone data samples is read out from the other output buffer in accordance with the output sampling clock pulses.
It is necessary for each of the output buffers to be able to store the 256 samples of tone data at one time, and to generate such 256 samples to be output, an input buffer must be provided which has a capacity several times greater than the total size of the to-be-output samples. Thus, these buffers would take an innegligibly large proportion of the total chip size of the tone generator LSI. Thus, if the capacity of the buffers can be safely reduced, it would be possible to reduce the chip size and hence the cost of the tone generator LSI, or to allocate another function to the LSI. Therefore, it may be proposed that the respective capacity of the individual buffers be reduced by dividing each of the frames into a plurality of subframes so that the above-mentioned tone generator processing is carried out on the subframe-by-subframe basis rather than the traditional frame-by-frame basis.
FIG. 6 is a conceptual block diagram illustrating an operational sequence when the tone generator processing is carried out for each of four subframes divided from one frame. Once the hardware issues to the microprogram MP a subframe start signal at predetermined subframe start timing, the microprogram MP starts running and simultaneously generates an interrupt signal Int. In response to the interrupt signal Int, the device driver DD starts subframe processing to prepare control data CD for use in a next subframe and also sets the flag Active2before the next subframe begins.
Although the scheme of FIG. 6 can reduce the total size of the buffers to one fourth of the total buffer size required in the traditional frame-by-frame tone generator processing technique, a time interval between the interrupt signals Int would also be made shorter by a factor of four as compared to the traditional tone generator processing, with the result that a total data quantity to be processed increases four times. Further, in the example of FIG. 6, the device driver DD must complete each necessary job within a subframe period of 1.3 ms; however, because the device driver DD operates on the operating system of the personal computer, it is possible that the device driver DD fails to complete the job within the subframe period due to operational relation with other application software. For example, in a situation where a given document is prepared by a word processing program while tones are reproduced via the device driver, such an inconvenience could occur as a data copying operation is effected by the word processing program. Also, in this case, the computer bus would be used exclusively for writing the data within a designated range into the main storage, so that the device driver DD can not use the bus at all and thus can not duly complete the job within the subframe period. Further, because the scheme of FIG. 6 involves an increased frequency of occurrence of the interrupt signal Int, the interrupt signal Int would occur even during a xe2x80x9cbusyxe2x80x9d state of the CPU so that the CPU sometimes can not immediately respond to the interrupt signal. For these reasons, the scheme of FIG. 6 could not carry out, for each of the subframes, the same processing as executed within each frame in the traditional technique.
It is therefore an object of the present invention to provide a tone data processing device and method which can smoothly carry out tone generator processing with a reduced buffer capacity.
To accomplish the above-mentioned object, the present invention provides an improved tone data processing device which comprises: a start signal generating section that generates a start signal every predetermined time when a subframe should be caused to begin; an interrupt signal generating section that generates a single interrupt signal per frame made up of a plurality of subframes; a control data preparing section that prepares control data for use in a next frame, in response to the interrupt signal generated by the interrupt signal generating section; and a tone data creating section that is activated in each of the subframes in response to the start signal generated by the start signal generating section, to collectively create tone data to be generated in the subframe on the basis of the control data prepared in an immediately preceding frame by the control data preparing section.
In the tone data processing device of the present invention, the tone data creating section carries out the operation of collectively creating tone data for each subframe having a capacity or time length several times smaller than that of a single frame, so that the necessary capacity of input and output buffers used can be greatly reduced. On the other hand, only one interrupt signal is generated per frame made up of a plurality of the subframes and thus it is only necessary that the control data preparing section, in response to the only one interrupt signal per frame, carry out the operation of preparing control data for use in the next frame, with the result that the load on the control data preparing section can be reduced significantly. Namely, it is possible to lower the frequency of interrupt occurrence to a CPU functioning as the control data preparing section, which can significantly lessen the load on the CPU.
Tone data processing system in accordance with a preferred implementation of the present invention includes a computer and a tone generator device for generating a tone signal under control of the computer, and the tone generator device comprises: a section that generates a start signal every predetermined time when a subframe should be caused to begin; a section that generates a single interrupt signal per frame made up of a plurality of subframes; and a tone data creating section that, in response to the start signal for each of the subframes, collectively creates tone data to be generated in the subframe on the basis of control data prepared by the computer. Here, the computer prepares the control data for use in a next frame, in response to the interrupt signal generated per frame by the tone generator device.
Preferably, the computer includes a memory storing waveform data, and the tone data creating section of the tone generator device carries out arithmetic operations to calculate a plurality of samples of the waveform data necessary for creating the tone data to be generated in the subframe, causes the calculated samples of the waveform data to be transferred from the memory, and then creates a plurality of samples of the tone data on the basis of the samples of the waveform data transferred from the memory.
The tone generator device may further include an output buffer and temporarily stores, into the output buffer, the plurality of samples of the tone data created by the tone data creating section. The plurality of samples of the tone data temporarily stored in the output buffer may be sequentially read out within a time period of the subframe in accordance with predetermined clock pulses in such a manner that a tone reproduction process is carried out at a predetermined sampling frequency.
The present invention may be implemented not only as the device invention but also as a method invention. The present invention may also be practiced as a program for execution by a computer, processor or the like, and also as a recording medium containing such a program.